package com.ksyun.campus.metaserver.domain;

/**
 * File type enumeration
 */
public enum FileType {
    UNKNOWN(0),
    VOLUME(1),
    FILE(2),
    DIR(3);

    private final int code;
    
    FileType(int code) {
        this.code = code;
    }
    
    public int getCode() {
        return code;
    }
    
    public static FileType get(int code) {
        switch (code) {
            case 1:
                return VOLUME;
            case 2:
                return FILE;
            case 3:
                return DIR;
            default:
                return UNKNOWN;
        }
    }
}
